<?php
	require_once 'db-connection.php';
	
	if(isset($_POST['username'])) {
		$username = $_POST["username"];
		$query =  "select username from users where username = '$username';";
		$statement = $dbConnection->execute($query);
		$count = $statement->num_rows();
		if($count == 1) {
			echo "<span style='color:red'>User name already exists! </span>";
		}
	}
?>